<template>
  <div class="home">
    <div class="welcome-section">
      <h1>工具集合</h1>
      <p>选择左侧菜单中的工具开始使用</p>
    </div>
    
    <div class="tools-grid">
      <div class="tool-card" @click="$router.push('/url-encoder')">
        <div class="tool-icon">🌐</div>
        <h3>URL 编码/解码</h3>
        <p>对URL字符串进行百分比编码和解码</p>
      </div>
      
      <div class="tool-card" @click="$router.push('/qr-generator')">
        <div class="tool-icon">📱</div>
        <h3>二维码生成器</h3>
        <p>将文本或链接转换为二维码</p>
      </div>
      
      <div class="tool-card" @click="$router.push('/properties-converter')">
        <div class="tool-icon">🔄</div>
        <h3>Properties 转换</h3>
        <p>Properties、YAML、XML格式互相转换</p>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
// 主页组件
</script>

<style scoped>
.home {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.welcome-section {
  text-align: center;
  margin-bottom: 3rem;
}

.welcome-section h1 {
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.welcome-section p {
  font-size: 1.2rem;
  color: #7f8c8d;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.tool-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid #e1e8ed;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: #3498db;
}

.tool-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.tool-card h3 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.tool-card p {
  color: #7f8c8d;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  .welcome-section h1 {
    color: #ecf0f1;
  }
  
  .welcome-section p {
    color: #bdc3c7;
  }
  
  .tool-card {
    background: #34495e;
    border-color: #4a5f7a;
  }
  
  .tool-card h3 {
    color: #ecf0f1;
  }
  
  .tool-card p {
    color: #bdc3c7;
  }
  
  .tool-card:hover {
    border-color: #3498db;
  }
}
</style>